var form = $("#resForm");
$(function () {
    $('.i-checks').iCheck({
        checkboxClass: 'icheckbox_square-green',
        radioClass: 'iradio_square-green',
    });

    $("#addAuthSubmit").click(function () {
        var form = $("#roleFormAdd");
        $.post('/sso/admin/res/save', form.serialize(), function (data, status) {
            if (data.status == 200) {
                parent.layer.msg("新增角色成功");
                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                parent.layer.close(index); //再执行关闭
            } else {
                parent.layer.msg("添加失败请重试");
            }
        });
    });
    form.validate({
        errorPlacement: function (error, element) {
            element.before(error);
        },
        rules: {}
    });
});